package com.jihu.design.behavioral.iterator;

/**
 * @author jihu
 * @date 2021/10/12
 */
public class MainTest {

    public static void main(String[] args) {
        ManYuCheng cheng = new ManYuCheng();

        cheng.likeYou("张三");
        cheng.likeYou("李四");
        cheng.likeYou("王五");

        BeautifulMan.Itr iterator = cheng.getIterator();
        System.out.println(iterator.firstLove());
        System.out.println(iterator.current());

        System.out.println("======================");

        while(iterator.hashNext()){
            System.out.println(iterator.next());
        }

    }
}
